Skip to content

Add oc-mirror-2.0 to PRODUCT_KUBECONFIG_MAP - #3182

Merged
ashwindasr merged 3 commits into
openshift-eng:mainfrom
ashwindasr:add-oc-mirror-2-kubeconfig-map
Jul 29, 2026
Merged

Add oc-mirror-2.0 to PRODUCT_KUBECONFIG_MAP#3182
ashwindasr merged 3 commits into
openshift-eng:mainfrom
ashwindasr:add-oc-mirror-2-kubeconfig-map

Conversation

@ashwindasr

@ashwindasr ashwindasr commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds oc-mirror-2.0 to PRODUCT_KUBECONFIG_MAP in artcommon/artcommonlib/constants.py, mapped to KONFLUX_SA_KUBECONFIG

Test plan

  • Verify PRODUCT_KUBECONFIG_MAP["oc-mirror-2.0"] returns "KONFLUX_SA_KUBECONFIG"

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added support for the oc-mirror product in kubeconfig configuration, including oc-mirror-2.0.
    • oc-mirror now uses the existing Konflux service account kubeconfig setting for authentication and environment setup.
    • oc-mirror is mapped to the ocp-art-tenant namespace.
    • Explicit kubeconfig path inputs take precedence over the default product-derived resolution.
  • Tests
    • Added unit coverage for product-based kubeconfig resolution and precedence behavior.

@openshift-ci

openshift-ci Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign thegreyd for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift-eng/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 97cb1583-3f6c-4696-905d-7e6cb9065a83

📥 Commits

Reviewing files that changed from the base of the PR and between f6c9434 and 9c716dc.

📒 Files selected for processing (2)
  • artcommon/artcommonlib/constants.py
  • artcommon/tests/test_util.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • artcommon/artcommonlib/constants.py

Walkthrough

The exported product mappings now include oc-mirror and oc-mirror-2.0 kubeconfig entries, with oc-mirror mapped to the ocp-art-tenant namespace. Tests cover environment-based resolution and explicit kubeconfig precedence.

Changes

Product kubeconfig support

Layer / File(s) Summary
Add product mappings
artcommon/artcommonlib/constants.py
Adds the oc-mirror namespace mapping and maps oc-mirror and oc-mirror-2.0 to KONFLUX_SA_KUBECONFIG.
Validate product resolution
artcommon/tests/test_util.py
Tests kubeconfig resolution for oc-mirror, oc-mirror-2.0, and ocp, including explicit-path precedence.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: approved, lgtm

Suggested reviewers: thegreyd, lgarciaaco

🚥 Pre-merge checks | ✅ 10 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Ai-Attribution ⚠️ Warning HEAD uses Co-Authored-By: Gemini CLI and lacks Assisted-by/Generated-by trailers. Replace the AI trailer with a Red Hat-approved Assisted-by: or Generated-by: trailer and remove Co-Authored-By for the AI tool.
✅ Passed checks (10 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is accurate and concise, though it mentions only the oc-mirror-2.0 kubeconfig map update and not the related oc-mirror additions or tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No-Weak-Crypto ✅ Passed Changed files only add product mappings and resolver tests; no weak crypto, custom crypto, or secret comparisons found.
Container-Privileges ✅ Passed PR only changes Python constants/tests; no container/K8s manifests or privilege settings (privileged, hostPID, allowPrivilegeEscalation, etc.) were added.
No-Sensitive-Data-In-Logs ✅ Passed The PR only adds product mappings and tests; no new logging statements or sensitive values are introduced in the changed files.
No-Hardcoded-Secrets ✅ Passed Changed files only add product kubeconfig mappings and tests; no secret-like literals, embedded creds, private keys, or long base64 strings found.
No-Injection-Vectors ✅ Passed Only constant mappings and unit tests changed; no eval/exec, shell=True, yaml.load, pickle.loads, os.system, or innerHTML patterns found.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@ashwindasr
ashwindasr force-pushed the add-oc-mirror-2-kubeconfig-map branch from 32eab89 to 18f55fd Compare July 17, 2026 19:09

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@artcommon/artcommonlib/constants.py`:
- Line 135: Add an explicit "oc-mirror-2.0" entry to the kubeconfig mapping
alongside the existing "oc-mirror" entry, mapping it to KONFLUX_SA_KUBECONFIG so
resolve_konflux_kubeconfig_by_product() resolves both product names identically.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift-eng/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 6efbd0bf-2f91-4fdb-b428-b743f939908e

📥 Commits

Reviewing files that changed from the base of the PR and between 18f55fd and f6c9434.

📒 Files selected for processing (1)
  • artcommon/artcommonlib/constants.py

Comment thread artcommon/artcommonlib/constants.py
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
Add explicit "oc-mirror-2.0" entry to the kubeconfig mapping alongside "oc-mirror", mapping it to KONFLUX_SA_KUBECONFIG so resolve_konflux_kubeconfig_by_product() resolves both product names identically.
Add unit tests in artcommon to verify product-based resolution for both variants.

Co-Authored-By: Gemini CLI <noreply@google.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
@ashwindasr
ashwindasr force-pushed the add-oc-mirror-2-kubeconfig-map branch from f6c9434 to 9c716dc Compare July 23, 2026 17:28
@openshift-ci

openshift-ci Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

@ashwindasr: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/security 9c716dc link false /test security

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@ashwindasr
ashwindasr merged commit 97ed2c7 into openshift-eng:main Jul 29, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant